package com.storm.lib.vo;

import java.util.ArrayList;
import java.util.List;

import com.storm.lib.base.BasePropertyVo;
import com.storm.lib.util.StringUtil;



/**
 * 
 * 类功能:掉落表达式
 * @author johnny
 * @version 2011-11-21
 */
public class DropConditionItemVo extends BasePropertyVo{
	/**
	 * 道具编号,0=什么都不掉
	 */
	private Integer itemId;
	/**
	 * 最小掉落
	 */
	private Integer minCount;
	/**
	 * 最大掉落
	 */
	private Integer maxCount;
	/**
	 * 权重
	 */
	private Integer weight;
	
	
	public Integer getItemId() {
		return itemId;
	}
	public void setItemId(Integer itemId) {
		this.itemId = itemId;
	}
	public Integer getMinCount() {
		return minCount;
	}
	public void setMinCount(Integer minCount) {
		this.minCount = minCount;
	}
	public Integer getMaxCount() {
		return maxCount;
	}
	public void setMaxCount(Integer maxCount) {
		this.maxCount = maxCount;
	}
	public Integer getWeight() {
		return weight;
	}
	public void setWeight(Integer weight) {
		this.weight = weight;
	}
	@Override
	public Object[] fetchProperyItems() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public void loadProperty(String val, String spliter) {
//		10032|1~2|80
		String[] vals = val.split("\\|");
		setItemId(Integer.valueOf(vals[0]));
		String[] nums = vals[1].split("~");
		if(nums.length==1){
			setMinCount(Integer.valueOf(nums[0]));
			setMaxCount(Integer.valueOf(nums[0]));
		}
		else{
			setMinCount(Integer.valueOf(nums[0]));
			setMaxCount(Integer.valueOf(nums[1]));
		}
		setWeight(Integer.valueOf(vals[2]));
	}
	

}
